package cn.com.xf.dao.demo;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;






public class demoExe {
	
	public static void main(String[] args) throws InterruptedException {
		Map<String,Object> map = new HashMap<>();
		map.put("单号",1111110001);
		map.put("省份",1);
		map.put("城市",1);
		map.put("地区",1);
		map.put("详细地址",1);
		List<Map> list = new ArrayList<>();
		list.add(map);
		list.add(map);
		list.add(map);
		list.add(map);
		System.out.println(list.size());
		String ii = JSONArray.fromObject(list).toString();
		System.out.println(ii);
		
		int cpuCount = Runtime.getRuntime().availableProcessors();
		ExecutorService exe = Executors.newFixedThreadPool(cpuCount*2); 
        for (int i = 1; i <= 5; i++) {
        	final int r = i;
            exe.execute(new Runnable() {				
				public void run() {
					System.out.println(r);
				}
			}); 
        } 
        exe.shutdown(); 
        while (true) { 
            if (exe.isTerminated()) { 
                System.out.println("结束了！"); 
                break; 
            }
            Thread.sleep(200);
        }
	}

}
